<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>
  <meta name="viewport" content="initial-scale=1,maximum-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <!--<link rel="shortcut icon" href="">-->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no">
</head>

<body>
  <textarea id="showStr"></textarea> //用来显示逐渐出现的文字
  <div style="display:none" id="string">宝贝，我好想好想你，想你想的睡不好觉，想你想的吃不下饭，我爱你爱你爱你，么么么么么么么么，啵啵啵啵啵啵啵 </div>

  <div id="blink">一段会闪烁的字</div>
  <script>
    var index = 0;
    var str = document.getElementById("string").innerHTML;
    function type() {
      if (index == str.length) {
        index = 0;
      }
      document.getElementById("showStr").innerText = str.substring(0, index++);
    }
    setInterval(type, 200); //通过定时器来让文字逐步显示  
  </script>
  <script type="text/javascript">
    function changeColor() {
      var color = "#f00|#0f0|#00f|#880|#808|#088|yellow|green|blue|gray";
      color = color.split("|");
      document.getElementById("blink").style.color = color[parseInt(Math.random() * color.length)];
    }
    setInterval("changeColor()", 200);  
  </script>
</body>

</html>